function getCode() {
    return new Promise((resolve, reject) => {
        try {
            wx.login({
                success: (res) => {
                    const { code } = res;
                    resolve(code)
                },
                fail: reject
            })
        } catch (err) {
            reject(err)
        }
    })
}

module.exports = getCode